#include "Body.h"


Body::Body(int newX,int newY,int newZ,GLUquadricObj *newP, GLint texture_id):Shape(texture_id)
{
	this->x = newX;
	this->y = newY;
	this->z = newZ;
	this->p = newP;
	this->HIP_BASE_RADIUS = 3;
	this->HIP_TOP_RADIUS = 2;
	this->Angle.xAngle = 0;
	this->Angle.yAngle = 0;
	this->Angle.zAngle = 0;
}

void Body::DrawHip()
{
	glPushMatrix();
	glEnable(GL_TEXTURE_2D);	
	glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
	gluQuadricTexture(this->p, GL_TRUE);
	gluQuadricDrawStyle(this->p, GLU_FILL);
	glBindTexture(GL_TEXTURE_2D, this->texture_id);
		 glColor3f(1, 0.6470, 0);

	 glTranslatef(this->x,this->y,this->z);
	// glRotatef(90, 0,1,0);
	 glRotatef(this->Anglecord.angle, this->Anglecord.xAngle,this->Anglecord.yAngle,this->Anglecord.zAngle);
	 gluCylinder(p,this->HIP_BASE_RADIUS,this->HIP_TOP_RADIUS,8,25,10);
	 gluSphere(p,3,20,50);

	 glColor3f(1, 0, 0);
	 glEnd();
	 glutPostRedisplay();
	glPopMatrix();
}

Body::~Body(void)
{
}
